/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI;


import java.awt.*;
import java.awt.event.ActionEvent;
import java.io.File;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.imageio.ImageIO;
import javax.swing.*;
import static javax.swing.SwingConstants.*;

/**
 *
 * @author Rui Margarido
 */
public class Start {
    
    JFrame frame = new JFrame("EasyScore - Inicio");
    PainelPrincipal frameInGame = new PainelPrincipal();
    public Start()
    {
        
        gui();
        //frame.add(MenuInicial());
        //frame.add(Imagem());
       /*
        JPanel panel = (JPanel) getContentPane();
        panel.setLayout(new BoxLayout(panel,BoxLayout.LINE_AXIS));
        panel.setSize(new Dimension(200,400));
        panel.setLocation(0,0);
        
        JPanel panel2 = new JPanel();
        panel2.setLayout(new FlowLayout());
        panel2.setLocation(201, 401);
       */ 
        //Container pane = getContentPane();
        //BoxLayout blayout = new BoxLayout(pane,0);
        //pane.setLayout(blayout);
        //JButton sair = new JButton("Sair");
        //JButton novo = new JButton("Novo Jogo");
        //sair.setAlignmentY(TOP_ALIGNMENT);
        //novo.setAlignmentY(TOP_ALIGNMENT);
        
        
        
        //sair.setHorizontalAlignment(RIGHT);
        //sair.setVerticalAlignment(TOP);
        //pane.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);


        //pack();
        

        
        
    }

    /*
    JPanel Imagem()
    {
        JPanel panel = new JPanel();
        panel.setLayout((new BoxLayout(panel,BoxLayout.PAGE_AXIS)));
        ImageIcon img1 = new ImageIcon(getClass().getResource("logo.png"));
        JLabel label = new JLabel(img1);
        panel.add(label);
        pack();
        return panel;
    }
    */
    
    /*
    JPanel MenuInicial()
    {
        
        JPanel panel = new JPanel();
        JButton sair = new JButton("Sair");
        JButton novo = new JButton("Novo Jogo");
        
        //sair.setAlignmentY(TOP_ALIGNMENT);
        //novo.setAlignmentY(TOP_ALIGNMENT);
       
       
        
        panel.setLayout((new BoxLayout(panel,BoxLayout.LINE_AXIS)));
        panel.add(novo);
        panel.add(Box.createRigidArea(new Dimension(634,0)));
        panel.add(sair);
        pack();
        return panel;
    }
    */
    public void gui()
    {  
        JPanel p = new JPanel();
        JButton sair = new JButton("Sair");
        JButton novo = new JButton("Novo Jogo");
        ImageIcon img1 = new ImageIcon(getClass().getClassLoader().getResource("Resources/logo.png"));
        JLabel label = new JLabel(img1);
        frame.setSize(800, 400);
        frame.setLocationRelativeTo(null);
        //frameInGame.setLocationRelativeTo(null);
        frame.setDefaultCloseOperation(frame.DISPOSE_ON_CLOSE);
        frame.setVisible(true);
        
         sair.addActionListener((ActionEvent event) -> {
            System.exit(0);
        });
        
        novo.addActionListener((ActionEvent event) -> {
            frameInGame.run();
            frame.dispose();
        });
        
        p.add(novo);
        p.add(sair);
        p.add(label);
        
        frame.add(p);
      
        //frame.pack();
    }
   
    public static void main(String [] args)
    {
        Start bota = new Start(); 
    }

}
